<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8" %>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%
    String ctx = request.getContextPath();
    request.setAttribute("ctx", ctx);
%>
<html>
<head>
    <title>Title</title>
    <script src="js/jquery-1.9.1.min.js"></script>
    <script src="My97DatePicker/WdatePicker.js"></script>
    <script >

             function ch(){
                 $("#t  tr:gt(0)").remove()

                $.ajax({
                    url:"manageList.do",
                    data:{"cid":$("[name='cid']").val(),"stime":$("[name='stime']").val()},
                    type:"post",
                    dataType:"json",
                    success:function (obj){
                        for(var i in obj){
                            if(obj[i].items=='应收账款'){
                                $("[name='ymoney']").val(obj[i].money)
                            }
                            if(obj[i].items=='资产负债率'){
                                $("[name='zmoney']").val(obj[i].money)
                            }
                            $("#t").append(" <tr>\n" +
                                "                    <td>"+obj[i].time+"</td>\n" +
                                "                    <td>"+obj[i].items+"</td>\n" +
                                "                    <td>"+obj[i].money+"</td>\n" +
                                "                </tr>")
                        }
                    }
                })
             }
    </script>
</head>
<body>
<table>
    <tr>
        <td><jsp:include page="/layout/left.jsp"></jsp:include></td>
        <td>
           <form >
               <!--可能会用到雪花算法-->
               <input type="hidden" name="cid" value="${param.cid}">
               工号：${user.cCode}    登录人姓名：${user.uName}
               年月： <input type="text" name="stime" onchange="ch()" onclick="WdatePicker({dateFmt:'yyyy-MM'})" class="Wdate" >
               应收账款： <input type="text" name="ymoney" >
                资产负债率：<input type="text" name="zmoney" >
               <input type="submit" >
           </form>
            <table id="t">
                <tr>
                    <td>年月</td>
                    <td>项目</td>
                    <td>金额</td>
                </tr>

            </table>
        </td>
    </tr>

</table>
</body>
</html>
